1 <?php
2
3 /**
4 * @file
5 * This file contains hook functions that get called when data operations are performed on 'symptoms' table.
6 * For example, when a new record is added, when a record is edited, when a record is deleted, … etc.
7 */
8
9 /**
10 * Called before rendering the page. This is a very powerful hook that allows you to control all aspects of how the page is rendered.
11 *
12 * @param $options
13 * (passed by reference) a DataList object that sets options for rendering the page.
14 * @see http://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks/DataList
15 *
16 * @param $memberInfo
17 * An array containing logged member's info.
18 * @see http://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks/memberInfo
19 *
20 * @param $args
21 * An empty array that is passed by reference. It's currently not used but is reserved for future uses.
22 *
23 * @return
24 * True to render the page. False to cancel the operation (which could be useful for error handling to display
25 * an error message to the user and stop displaying any data).
26 */
27
28 function symptoms_init(&$options, $memberInfo, &$args){
29
30 return TRUE;
31 }
32
33 /**
34 * Called before displaying page content. Can be used to return a customized header template for the table.
35 *
36 * @param $contentType
37 * specifies the type of view that will be displayed. Takes one the following values:
38 * 'tableview', 'detailview', 'tableview+detailview', 'print-tableview', 'print-detailview', 'filters'
39 *
40 * @param $memberInfo
41 * An array containing logged member's info.
42 * @see http://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks/memberInfo
43 *
44 * @param $args
45 * An empty array that is passed by reference. It's currently not used but is reserved for future uses.
46 *
47 * @return
48 * String containing the HTML header code. If empty, the default 'header.php' is used. If you want to include
49 * the default header besides your customized header, include the <%%HEADER%%> placeholder in the returned string.
50 */
51
52 function symptoms_header($contentType, $memberInfo, &$args){
53 $header='';
54
55 switch($contentType){
56 case 'tableview':
57 $header='';
58 break;
59
60 case 'detailview':
61 $header='';
62 break;
63
64 case 'tableview+detailview':
65 $header='';
66 break;
67
68 case 'print-tableview':
69 $header='';
70 break;
71
72 case 'print-detailview':
73 $header='';
74 break;
75
76 case 'filters':
77 $header='';
78 break;
79 }
80
81 return $header;
82 }
83
84 /**
85 * Called after displaying page content. Can be used to return a customized footer template for the table.
86 *
87 * @param $contentType
88 * specifies the type of view that will be displayed. Takes one the following values:
89 * 'tableview', 'detailview', 'tableview+detailview', 'print-tableview', 'print-detailview', 'filters'
90 *
91 * @param $memberInfo
92 * An array containing logged member's info.
93 * @see http://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks/memberInfo
94 *
95 * @param $args
96 * An empty array that is passed by reference. It's currently not used but is reserved for future uses.
97 *
98 * @return
99 * String containing the HTML footer code. If empty, the default 'footer.php' is used. If you want to include
100 * the default footer besides your customized footer, include the <%%FOOTER%%> placeholder in the returned string.
101 */
102
103 function symptoms_footer($contentType, $memberInfo, &$args){
104 $footer='';
105
106 switch($contentType){
107 case 'tableview':
108 $footer='';
109 break;
110
111 case 'detailview':
112 $footer='';
113 break;
114
115 case 'tableview+detailview':
116 $footer='';
117 break;
118
119 case 'print-tableview':
120 $footer='';
121 break;
122
123 case 'print-detailview':
124 $footer='';
125 break;
126
127 case 'filters':
128 $footer='';
129 break;
130 }
131
132 return $footer;
133 }
134
135 /**
136 * Called before executing the insert query.
137 *
138 * @param $data
139 * An associative array where the keys are field names and the values are the field data values to be inserted into the new record.
140 * For this table, the array items are:
141 * $data['name'], $data['description'], $data['comments']
142 * $data array is passed by reference so that modifications to it apply to the insert query.
143 *
144 * @param $memberInfo
145 * An array containing logged member's info.
146 * @see http://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks/memberInfo
147 *
148 * @param $args
149 * An empty array that is passed by reference. It's currently not used but is reserved for future uses.
150 *
151 * @return
152 * A boolean TRUE to perform the insert operation, or FALSE to cancel it.
153 */
154
155 function symptoms_before_insert(&$data, $memberInfo, &$args){
156
157 return TRUE;
158 }
159
160 /**
161 * Called after executing the insert query (but before executing the ownership insert query).
162 *
163 * @param $data
164 * An associative array where the keys are field names and the values are the field data values that were inserted into the new record.
165 * For this table, the array items are:
166 * $data['name'], $data['description'], $data['comments']
167 * Also includes the item $data['selectedID'] which stores the value of the primary key for the new record.
168 *
169 * @param $memberInfo
170 * An array containing logged member's info.
171 * @see http://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks/memberInfo
172 *
173 * @param $args
174 * An empty array that is passed by reference. It's currently not used but is reserved for future uses.
175 *
176 * @return
177 * A boolean TRUE to perform the ownership insert operation or FALSE to cancel it.
178 * Warning: if a FALSE is returned, the new record will have no ownership info.
179 */
180
181 function symptoms_after_insert($data, $memberInfo, &$args){
182
183 return TRUE;
184 }
185
186 /**
187 * Called before executing the update query.
188 *
189 * @param $data
190 * An associative array where the keys are field names and the values are the field data values.
191 * For this table, the array items are:
192 * $data['id'], $data['name'], $data['description'], $data['comments']
193 * Also includes the item $data['selectedID'] which stores the value of the primary key for the record to be updated.
194 * $data array is passed by reference so that modifications to it apply to the update query.
195 *
196 * @param $memberInfo
197 * An array containing logged member's info.
198 * @see http://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks/memberInfo
199 *
200 * @param $args
201 * An empty array that is passed by reference. It's currently not used but is reserved for future uses.
202 *
203 * @return
204 * True to perform the update operation or false to cancel it.
205 */
206
207 function symptoms_before_update(&$data, $memberInfo, &$args){
208
209 return TRUE;
210 }
211
212 /**
213 * Called after executing the update query and before executing the ownership update query.
214 *
215 * @param $data
216 * An associative array where the keys are field names and the values are the field data values.
217 * For this table, the array items are:
218 * $data['id'], $data['name'], $data['description'], $data['comments']
219 * Also includes the item $data['selectedID'] which stores the value of the primary key for the record.
220 *
221 * @param $memberInfo
222 * An array containing logged member's info.
223 * @see http://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks/memberInfo
224 *
225 * @param $args
226 * An empty array that is passed by reference. It's currently not used but is reserved for future uses.
227 *
228 * @return
229 * True to perform the ownership update operation or false to cancel it.
230 */
231
232 function symptoms_after_update($data, $memberInfo, &$args){
233
234 return TRUE;
235 }
236
237 /**
238 * Called before deleting a record (and before performing child records check).
239 *
240 * @param $selectedID
241 * The primary key value of the record to be deleted.
242 *
243 * @param $skipChecks
244 * A flag passed by reference that determines whether child records check should be performed or not.
245 * If you set $skipChecks to TRUE, no child records check will be made. If you set it to FALSE, the check will be performed.
246 *
247 * @param $memberInfo
248 * An array containing logged member's info.
249 * @see http://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks/memberInfo
250 *
251 * @param $args
252 * An empty array that is passed by reference. It's currently not used but is reserved for future uses.
253 *
254 * @return
255 * True to perform the delete operation or false to cancel it.
256 */
257
258 function symptoms_before_delete($selectedID, &$skipChecks, $memberInfo, &$args){
259
260 return TRUE;
261 }
262
263 /**
264 * Called after deleting a record.
265 *
266 * @param $selectedID
267 * The primary key value of the record to be deleted.
268 *
269 * @param $memberInfo
270 * An array containing logged member's info.
271 * @see http://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks/memberInfo
272 *
273 * @param $args
274 * An empty array that is passed by reference. It's currently not used but is reserved for future uses.
275 *
276 * @return
277 * None.
278 */
279
280 function symptoms_after_delete($selectedID, $memberInfo, &$args){
281
282 }
283
284 /**
285 * Called when a user requests to view the detail view (before displaying the detail view).
286 *
287 * @param $selectedID
288 * The primary key value of the record selected. False if no record is selected (i.e. the detail view will be
289 * displayed to enter a new record).
290 *
291 * @param $memberInfo
292 * An array containing logged member's info.
293 * @see http://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks/memberInfo
294 *
295 * @param $html
296 * (passed by reference) the HTML code of the form ready to be displayed. This could be useful for manipulating
297 * the code before displaying it using regular expressions, … etc.
298 *
299 * @param $args
300 * An empty array that is passed by reference. It's currently not used but is reserved for future uses.
301 *
302 * @return
303 * None.
304 */
305
306 function symptoms_dv($selectedID, $memberInfo, &$html, &$args){
307
308 }
309
310 /**
311 * Called when a user requests to download table data as a CSV file (by clicking on the SAVE CSV button)
312 *
313 * @param $query
314 * Contains the query that will be executed to return the data in the CSV file.
315 *
316 * @param $memberInfo
317 * An array containing logged member's info.
318 * @see http://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks/memberInfo
319 *
320 * @param $args
321 * An empty array. It's currently not used but is reserved for future uses.
322 *
323 * @return
324 * A string containing the query to use for fetching the CSV data. If FALSE or empty is returned, the default query is used.
325 */
326
327 function symptoms_csv($query, $memberInfo, $args){
328
329 return $query;
330 }